<?php

namespace App\Model;
use Illuminate\Database\Eloquent\Model;
class AdminPermission extends Model
{
    // protected $table = 'admin_role_user';
	protected $fillable = [
        'id',
        'name',
        'description',
    ]; 
    /*
     * 权限属于哪些角色
     */
    public function roles()
    {
        return $this->belongsToMany(\App\Model\AdminRole::class, 'admin_permission_role', 'role_id', 'permission_id')->withPivot(['permission_id', 'role_id']);
    }
}
